/**
 * Copyright (C) 2018 - 2020 https://github.com/LeeYan9
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.bifrost.entity;

import com.bifrost.constant.MerchantConfigurationType;
import lombok.Data;

import javax.persistence.*;
import java.util.List;

/**
 * @author Lee
 * Create Class on 2018/9/6
 * @com.bifrost.entity
 * @wechat-mall
 */
@Entity
@Table(name = "CONFIGURATION_ALIAS")
@Data
public class MerchantConfigurationAlias {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "CONFIGURATION_ALIAS_ID", unique = true, nullable = false)
    private Long ConfigurationAliasId;

    @Column(name="TYPE_ALIAS" , columnDefinition = "varchar(50) DEFAULT NULL COMMENT '配置类型描述'")
    private String typeAlias;
    @Column(name="KEY_ALIAS" , columnDefinition = "varchar(50) DEFAULT NULL COMMENT '配置类型KEY描述'")
    private String keyAlias;
    @Column(name="VALUE_ALIAS" , columnDefinition = "varchar(50) DEFAULT NULL COMMENT '配置类型Value描述'")
    private String valueAlias;
    @Column(name="TYPE")
    @Enumerated(value = EnumType.STRING)
    private MerchantConfigurationType merchantConfigurationType = MerchantConfigurationType.INTEGRATION;

    @Column(name="VISIBLE" , columnDefinition = "bit(1) DEFAULT NULL COMMENT '是否可见'")
    private Boolean visible = Boolean.TRUE;

    @OneToMany(mappedBy = "configurationAlias")
    @org.hibernate.annotations.ForeignKey(name = "none")
    private List<MerchantConfiguration> configurations;

}
